<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>async</title>
</head>
<body>
    <script>
        //返回非promise
        async function main1(){
            return "520wcc";
        }
        let res1 = main1();
        console.log(res1)
        /*2.返回promise对象*/
        async function main2(){
            return new Promise((resolve, reject) => {
                reject("error");
            })
        }
        let res2 = main2();
        console.log(res2)
        /*抛出错误*/
        async function main3(){
            throw "warnning";
        }
        let res3 = main3();
        console.log(res3);
    </script>
</body>
</html>